package asimes.datastructure.graph;

import java.util.LinkedList;
import java.util.List;

public class Graph {
    private int v;
    private List<Integer>[] list;

    public Graph(int v) {
        this.v = v;
        list = new LinkedList[v];
        for (int i = 0; i < v; i++) {
            list[i] = new LinkedList<>();
        }
    }

    public void addEdge(int s, int t) {
        list[s].add(t);
        list[t].add(s);
    }
}
